#include <bits/stdc++.h>

using namespace std;

class Solution
{
public:
    int countAsterisks(string s)
    {
        int res = 0;
        bool is_true = true;

        for (auto &ch : s)
        {
            if (ch == '|')
            {
                is_true = !is_true;
            }
            else if (ch == '*' && is_true)
            {
                res++;
            }
        }

        return res;
    }
};